<?php






function giveTracks($artist, $album){

$first='http://ws.audioscrobbler.com/2.0/?method=album.getinfo&format=json&api_key=b25b959554ed76058ac220b7b2e0a026&artist=';
$key='&api_key=2e0f6a31b6598dae0585ac68964d579c';
$second='&album=';
$artist=str_replace(' ','%20',$artist);
$album=str_replace(' ','%20',$album);
  

$url=$first.$artist.$second.$album;


$html=  file_get_contents($url,true);
$json=  json_decode($html,true);

//$track1=$json['album']['tracks']['track']['15']['name'];
//print($track1);
	
	
	$tracks=array();
	
	$array=$json['album']['tracks']['track'];
	

	
	
	for($i=0; $i<count($array); $i++){
		$newtrack=$array[$i]['name'];
		array_push($tracks,$newtrack);
	}
	
	return ($tracks);
}



$out=giveTracks('jedi mind tricks', 'servants in heaven, kings in hell');
print_r($out);
?>